//Filename    : ContactDlg.cs
//Part of     : PIM Navigator C# example
//Description : Implementation of "New Contact" dialog
//Version     : 3.2
//
//This example is only to be used with PC Connectivity API version 3.2.
//Compability ("as is") with future versions is not quaranteed.
//
//Copyright (c) 2007 Nokia Corporation.
//
//This material, including but not limited to documentation and any related
//computer programs, is protected by intellectual property rights of Nokia
//Corporation and/or its licensors.
//All rights are reserved. Reproducing, modifying, translating, or
//distributing any or all of this material requires the prior written consent
//of Nokia Corporation. Nokia Corporation retains the right to make changes
//to this material at any time without notice. A copyright license is hereby
//granted to download and print a copy of this material for personal use only.
//No other license to any other intellectual property rights is granted. The
//material is provided "as is" without warranty of any kind, either express or
//implied, including without limitation, any warranty of non-infringement,
//merchantability and fitness for a particular purpose. In no event shall
//Nokia Corporation be liable for any direct, indirect, special, incidental,
//or consequential loss or damages, including but not limited to, lost profits
//or revenue,loss of use, cost of substitute program, or loss of data or
//equipment arising out of the use or inability to use the material, even if
//Nokia Corporation has been advised of the likelihood of such damages occurring.

using System.Runtime.InteropServices;
namespace CSPimNavigator.NET
{
    public class ContactDlg : System.Windows.Forms.Form
    {

        #region " Windows Form Designer generated code "

        public ContactDlg()
            : base()
        {

            //This call is required by the Windows Form Designer.
            InitializeComponent();

            //Add any initialization after the InitializeComponent() call

        }

        //Form overrides dispose to clean up the component list.
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if ((components != null))
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        internal System.Windows.Forms.TextBox TXT_Note;
        internal System.Windows.Forms.Label LBL_NOTE;
        internal System.Windows.Forms.Label LBL_GeneralFields;
        internal System.Windows.Forms.TextBox TXT_Web;
        internal System.Windows.Forms.Label LBL_Web;
        internal System.Windows.Forms.TextBox TXT_Email;
        internal System.Windows.Forms.Label LBL_Email;
        internal System.Windows.Forms.Button BTN_Addresses;
        internal System.Windows.Forms.Label LBL_Addresses;
        internal System.Windows.Forms.TextBox TXT_Fax;
        internal System.Windows.Forms.Label LBL_Fax;
        internal System.Windows.Forms.TextBox TXT_General;
        internal System.Windows.Forms.Label LBL_GeneralNumber;
        internal System.Windows.Forms.Label LBL_Numbers;
        internal System.Windows.Forms.DateTimePicker DTP_Birthday;
        internal System.Windows.Forms.Label LBL_Birthday;
        internal System.Windows.Forms.TextBox TXT_Company;
        internal System.Windows.Forms.Label LBL_Company;
        internal System.Windows.Forms.TextBox TXT_Job;
        internal System.Windows.Forms.Label LBL_Job;
        internal System.Windows.Forms.TextBox TXT_LastName;
        internal System.Windows.Forms.Label LBL_LastName;
        internal System.Windows.Forms.Label LabelPIM;
        internal System.Windows.Forms.Button BTN_OK;
        internal System.Windows.Forms.Button BTN_Cancel;
        internal System.Windows.Forms.TextBox TXT_Work;
        internal System.Windows.Forms.Label LBL_WorkNumber;
        internal System.Windows.Forms.TextBox TXT_Home;
        internal System.Windows.Forms.Label LBL_HomeNumber;
        internal System.Windows.Forms.TextBox TXT_FirstName;
        internal System.Windows.Forms.Label LBL_FisrtName;
        internal System.Windows.Forms.TextBox TXT_Mobile;
        internal System.Windows.Forms.Label LBL_MobileNumber;

        //Required by the Windows Form Designer
        private System.ComponentModel.IContainer components;

        //NOTE: The following procedure is required by the Windows Form Designer
        //It can be modified using the Windows Form Designer.  
        //Do not modify it using the code editor.
        [System.Diagnostics.DebuggerStepThrough()]
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ContactDlg));
            this.TXT_Note = new System.Windows.Forms.TextBox();
            this.LBL_NOTE = new System.Windows.Forms.Label();
            this.LBL_GeneralFields = new System.Windows.Forms.Label();
            this.TXT_Web = new System.Windows.Forms.TextBox();
            this.LBL_Web = new System.Windows.Forms.Label();
            this.TXT_Email = new System.Windows.Forms.TextBox();
            this.LBL_Email = new System.Windows.Forms.Label();
            this.BTN_Addresses = new System.Windows.Forms.Button();
            this.LBL_Addresses = new System.Windows.Forms.Label();
            this.TXT_Fax = new System.Windows.Forms.TextBox();
            this.LBL_Fax = new System.Windows.Forms.Label();
            this.TXT_General = new System.Windows.Forms.TextBox();
            this.LBL_GeneralNumber = new System.Windows.Forms.Label();
            this.LBL_Numbers = new System.Windows.Forms.Label();
            this.DTP_Birthday = new System.Windows.Forms.DateTimePicker();
            this.LBL_Birthday = new System.Windows.Forms.Label();
            this.TXT_Company = new System.Windows.Forms.TextBox();
            this.LBL_Company = new System.Windows.Forms.Label();
            this.TXT_Job = new System.Windows.Forms.TextBox();
            this.LBL_Job = new System.Windows.Forms.Label();
            this.TXT_LastName = new System.Windows.Forms.TextBox();
            this.LBL_LastName = new System.Windows.Forms.Label();
            this.LabelPIM = new System.Windows.Forms.Label();
            this.BTN_OK = new System.Windows.Forms.Button();
            this.BTN_Cancel = new System.Windows.Forms.Button();
            this.TXT_Work = new System.Windows.Forms.TextBox();
            this.LBL_WorkNumber = new System.Windows.Forms.Label();
            this.TXT_Home = new System.Windows.Forms.TextBox();
            this.LBL_HomeNumber = new System.Windows.Forms.Label();
            this.TXT_FirstName = new System.Windows.Forms.TextBox();
            this.LBL_FisrtName = new System.Windows.Forms.Label();
            this.TXT_Mobile = new System.Windows.Forms.TextBox();
            this.LBL_MobileNumber = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // TXT_Note
            // 
            this.TXT_Note.Location = new System.Drawing.Point(112, 316);
            this.TXT_Note.Multiline = true;
            this.TXT_Note.Name = "TXT_Note";
            this.TXT_Note.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.TXT_Note.Size = new System.Drawing.Size(162, 92);
            this.TXT_Note.TabIndex = 63;
            // 
            // LBL_NOTE
            // 
            this.LBL_NOTE.AutoSize = true;
            this.LBL_NOTE.Location = new System.Drawing.Point(12, 312);
            this.LBL_NOTE.Name = "LBL_NOTE";
            this.LBL_NOTE.Size = new System.Drawing.Size(33, 13);
            this.LBL_NOTE.TabIndex = 62;
            this.LBL_NOTE.Text = "Note:";
            // 
            // LBL_GeneralFields
            // 
            this.LBL_GeneralFields.AutoSize = true;
            this.LBL_GeneralFields.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.LBL_GeneralFields.Location = new System.Drawing.Point(12, 289);
            this.LBL_GeneralFields.Name = "LBL_GeneralFields";
            this.LBL_GeneralFields.Size = new System.Drawing.Size(76, 15);
            this.LBL_GeneralFields.TabIndex = 61;
            this.LBL_GeneralFields.Text = "General fields:";
            // 
            // TXT_Web
            // 
            this.TXT_Web.Location = new System.Drawing.Point(371, 262);
            this.TXT_Web.Name = "TXT_Web";
            this.TXT_Web.Size = new System.Drawing.Size(174, 20);
            this.TXT_Web.TabIndex = 60;
            // 
            // LBL_Web
            // 
            this.LBL_Web.AutoSize = true;
            this.LBL_Web.Location = new System.Drawing.Point(288, 266);
            this.LBL_Web.Name = "LBL_Web";
            this.LBL_Web.Size = new System.Drawing.Size(73, 13);
            this.LBL_Web.TabIndex = 59;
            this.LBL_Web.Text = "Web address:";
            // 
            // TXT_Email
            // 
            this.TXT_Email.Location = new System.Drawing.Point(112, 262);
            this.TXT_Email.Name = "TXT_Email";
            this.TXT_Email.Size = new System.Drawing.Size(163, 20);
            this.TXT_Email.TabIndex = 58;
            // 
            // LBL_Email
            // 
            this.LBL_Email.AutoSize = true;
            this.LBL_Email.Location = new System.Drawing.Point(12, 266);
            this.LBL_Email.Name = "LBL_Email";
            this.LBL_Email.Size = new System.Drawing.Size(35, 13);
            this.LBL_Email.TabIndex = 57;
            this.LBL_Email.Text = "Email:";
            // 
            // BTN_Addresses
            // 
            this.BTN_Addresses.Location = new System.Drawing.Point(112, 228);
            this.BTN_Addresses.Name = "BTN_Addresses";
            this.BTN_Addresses.Size = new System.Drawing.Size(75, 23);
            this.BTN_Addresses.TabIndex = 56;
            this.BTN_Addresses.Text = "Address...";
            this.BTN_Addresses.UseVisualStyleBackColor = true;
            this.BTN_Addresses.Click += new System.EventHandler(this.BTN_Addresses_Click);
            // 
            // LBL_Addresses
            // 
            this.LBL_Addresses.AutoSize = true;
            this.LBL_Addresses.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.LBL_Addresses.Location = new System.Drawing.Point(12, 233);
            this.LBL_Addresses.Name = "LBL_Addresses";
            this.LBL_Addresses.Size = new System.Drawing.Size(61, 15);
            this.LBL_Addresses.TabIndex = 55;
            this.LBL_Addresses.Text = "Addresses:";
            // 
            // TXT_Fax
            // 
            this.TXT_Fax.Location = new System.Drawing.Point(112, 194);
            this.TXT_Fax.Name = "TXT_Fax";
            this.TXT_Fax.Size = new System.Drawing.Size(163, 20);
            this.TXT_Fax.TabIndex = 54;
            // 
            // LBL_Fax
            // 
            this.LBL_Fax.AutoSize = true;
            this.LBL_Fax.Location = new System.Drawing.Point(12, 198);
            this.LBL_Fax.Name = "LBL_Fax";
            this.LBL_Fax.Size = new System.Drawing.Size(65, 13);
            this.LBL_Fax.TabIndex = 53;
            this.LBL_Fax.Text = "Fax number:";
            // 
            // TXT_General
            // 
            this.TXT_General.Location = new System.Drawing.Point(112, 139);
            this.TXT_General.Name = "TXT_General";
            this.TXT_General.Size = new System.Drawing.Size(163, 20);
            this.TXT_General.TabIndex = 46;
            // 
            // LBL_GeneralNumber
            // 
            this.LBL_GeneralNumber.AutoSize = true;
            this.LBL_GeneralNumber.Location = new System.Drawing.Point(12, 143);
            this.LBL_GeneralNumber.Name = "LBL_GeneralNumber";
            this.LBL_GeneralNumber.Size = new System.Drawing.Size(87, 13);
            this.LBL_GeneralNumber.TabIndex = 45;
            this.LBL_GeneralNumber.Text = "General Number:";
            // 
            // LBL_Numbers
            // 
            this.LBL_Numbers.AutoSize = true;
            this.LBL_Numbers.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.LBL_Numbers.Location = new System.Drawing.Point(12, 113);
            this.LBL_Numbers.Name = "LBL_Numbers";
            this.LBL_Numbers.Size = new System.Drawing.Size(51, 15);
            this.LBL_Numbers.TabIndex = 44;
            this.LBL_Numbers.Text = "Numbers";
            // 
            // DTP_Birthday
            // 
            this.DTP_Birthday.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.DTP_Birthday.Location = new System.Drawing.Point(112, 85);
            this.DTP_Birthday.Name = "DTP_Birthday";
            this.DTP_Birthday.Size = new System.Drawing.Size(92, 20);
            this.DTP_Birthday.TabIndex = 43;
            this.DTP_Birthday.Value = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);
            // 
            // LBL_Birthday
            // 
            this.LBL_Birthday.AutoSize = true;
            this.LBL_Birthday.Location = new System.Drawing.Point(12, 89);
            this.LBL_Birthday.Name = "LBL_Birthday";
            this.LBL_Birthday.Size = new System.Drawing.Size(48, 13);
            this.LBL_Birthday.TabIndex = 42;
            this.LBL_Birthday.Text = "Birthday:";
            // 
            // TXT_Company
            // 
            this.TXT_Company.Location = new System.Drawing.Point(369, 57);
            this.TXT_Company.Name = "TXT_Company";
            this.TXT_Company.Size = new System.Drawing.Size(176, 20);
            this.TXT_Company.TabIndex = 41;
            // 
            // LBL_Company
            // 
            this.LBL_Company.AutoSize = true;
            this.LBL_Company.Location = new System.Drawing.Point(288, 61);
            this.LBL_Company.Name = "LBL_Company";
            this.LBL_Company.Size = new System.Drawing.Size(54, 13);
            this.LBL_Company.TabIndex = 40;
            this.LBL_Company.Text = "Company:";
            // 
            // TXT_Job
            // 
            this.TXT_Job.Location = new System.Drawing.Point(112, 57);
            this.TXT_Job.Name = "TXT_Job";
            this.TXT_Job.Size = new System.Drawing.Size(163, 20);
            this.TXT_Job.TabIndex = 39;
            // 
            // LBL_Job
            // 
            this.LBL_Job.AutoSize = true;
            this.LBL_Job.Location = new System.Drawing.Point(12, 61);
            this.LBL_Job.Name = "LBL_Job";
            this.LBL_Job.Size = new System.Drawing.Size(46, 13);
            this.LBL_Job.TabIndex = 38;
            this.LBL_Job.Text = "Job title:";
            // 
            // TXT_LastName
            // 
            this.TXT_LastName.Location = new System.Drawing.Point(369, 32);
            this.TXT_LastName.Name = "TXT_LastName";
            this.TXT_LastName.Size = new System.Drawing.Size(176, 20);
            this.TXT_LastName.TabIndex = 37;
            // 
            // LBL_LastName
            // 
            this.LBL_LastName.AutoSize = true;
            this.LBL_LastName.Location = new System.Drawing.Point(288, 35);
            this.LBL_LastName.Name = "LBL_LastName";
            this.LBL_LastName.Size = new System.Drawing.Size(59, 13);
            this.LBL_LastName.TabIndex = 36;
            this.LBL_LastName.Text = "Last name:";
            // 
            // LabelPIM
            // 
            this.LabelPIM.AutoSize = true;
            this.LabelPIM.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.LabelPIM.Location = new System.Drawing.Point(12, 9);
            this.LabelPIM.Name = "LabelPIM";
            this.LabelPIM.Size = new System.Drawing.Size(105, 15);
            this.LabelPIM.TabIndex = 33;
            this.LabelPIM.Text = "Personal Information";
            // 
            // BTN_OK
            // 
            this.BTN_OK.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.BTN_OK.Location = new System.Drawing.Point(377, 384);
            this.BTN_OK.Name = "BTN_OK";
            this.BTN_OK.Size = new System.Drawing.Size(80, 24);
            this.BTN_OK.TabIndex = 64;
            this.BTN_OK.Text = "OK";
            // 
            // BTN_Cancel
            // 
            this.BTN_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.BTN_Cancel.Location = new System.Drawing.Point(463, 384);
            this.BTN_Cancel.Name = "BTN_Cancel";
            this.BTN_Cancel.Size = new System.Drawing.Size(80, 24);
            this.BTN_Cancel.TabIndex = 65;
            this.BTN_Cancel.Text = "Cancel";
            // 
            // TXT_Work
            // 
            this.TXT_Work.Location = new System.Drawing.Point(385, 166);
            this.TXT_Work.Name = "TXT_Work";
            this.TXT_Work.Size = new System.Drawing.Size(160, 20);
            this.TXT_Work.TabIndex = 52;
            // 
            // LBL_WorkNumber
            // 
            this.LBL_WorkNumber.Location = new System.Drawing.Point(288, 168);
            this.LBL_WorkNumber.Name = "LBL_WorkNumber";
            this.LBL_WorkNumber.Size = new System.Drawing.Size(88, 16);
            this.LBL_WorkNumber.TabIndex = 51;
            this.LBL_WorkNumber.Text = "Work number:";
            // 
            // TXT_Home
            // 
            this.TXT_Home.Location = new System.Drawing.Point(112, 166);
            this.TXT_Home.Name = "TXT_Home";
            this.TXT_Home.Size = new System.Drawing.Size(163, 20);
            this.TXT_Home.TabIndex = 50;
            // 
            // LBL_HomeNumber
            // 
            this.LBL_HomeNumber.Location = new System.Drawing.Point(12, 168);
            this.LBL_HomeNumber.Name = "LBL_HomeNumber";
            this.LBL_HomeNumber.Size = new System.Drawing.Size(88, 16);
            this.LBL_HomeNumber.TabIndex = 49;
            this.LBL_HomeNumber.Text = "Home number:";
            // 
            // TXT_FirstName
            // 
            this.TXT_FirstName.Location = new System.Drawing.Point(112, 32);
            this.TXT_FirstName.Name = "TXT_FirstName";
            this.TXT_FirstName.Size = new System.Drawing.Size(163, 20);
            this.TXT_FirstName.TabIndex = 35;
            // 
            // LBL_FisrtName
            // 
            this.LBL_FisrtName.Location = new System.Drawing.Point(12, 34);
            this.LBL_FisrtName.Name = "LBL_FisrtName";
            this.LBL_FisrtName.Size = new System.Drawing.Size(88, 16);
            this.LBL_FisrtName.TabIndex = 34;
            this.LBL_FisrtName.Text = "Fisrt name:";
            // 
            // TXT_Mobile
            // 
            this.TXT_Mobile.Location = new System.Drawing.Point(385, 139);
            this.TXT_Mobile.Name = "TXT_Mobile";
            this.TXT_Mobile.Size = new System.Drawing.Size(160, 20);
            this.TXT_Mobile.TabIndex = 48;
            // 
            // LBL_MobileNumber
            // 
            this.LBL_MobileNumber.Location = new System.Drawing.Point(288, 141);
            this.LBL_MobileNumber.Name = "LBL_MobileNumber";
            this.LBL_MobileNumber.Size = new System.Drawing.Size(88, 16);
            this.LBL_MobileNumber.TabIndex = 47;
            this.LBL_MobileNumber.Text = "Mobile number:";
            // 
            // ContactDlg
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(554, 425);
            this.Controls.Add(this.TXT_Note);
            this.Controls.Add(this.LBL_NOTE);
            this.Controls.Add(this.LBL_GeneralFields);
            this.Controls.Add(this.TXT_Web);
            this.Controls.Add(this.LBL_Web);
            this.Controls.Add(this.TXT_Email);
            this.Controls.Add(this.LBL_Email);
            this.Controls.Add(this.BTN_Addresses);
            this.Controls.Add(this.LBL_Addresses);
            this.Controls.Add(this.TXT_Fax);
            this.Controls.Add(this.LBL_Fax);
            this.Controls.Add(this.TXT_General);
            this.Controls.Add(this.LBL_GeneralNumber);
            this.Controls.Add(this.LBL_Numbers);
            this.Controls.Add(this.DTP_Birthday);
            this.Controls.Add(this.LBL_Birthday);
            this.Controls.Add(this.TXT_Company);
            this.Controls.Add(this.LBL_Company);
            this.Controls.Add(this.TXT_Job);
            this.Controls.Add(this.LBL_Job);
            this.Controls.Add(this.TXT_LastName);
            this.Controls.Add(this.LBL_LastName);
            this.Controls.Add(this.LabelPIM);
            this.Controls.Add(this.BTN_OK);
            this.Controls.Add(this.BTN_Cancel);
            this.Controls.Add(this.TXT_Work);
            this.Controls.Add(this.LBL_WorkNumber);
            this.Controls.Add(this.TXT_Home);
            this.Controls.Add(this.LBL_HomeNumber);
            this.Controls.Add(this.TXT_FirstName);
            this.Controls.Add(this.LBL_FisrtName);
            this.Controls.Add(this.TXT_Mobile);
            this.Controls.Add(this.LBL_MobileNumber);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "ContactDlg";
            this.Text = "New Contact";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private void BTN_Addresses_Click(object sender, System.EventArgs e)
        {
            AddressDlg addressDlg = new AddressDlg();
            addressDlg.TXT_POBox.Text = strPOBox;
            addressDlg.TXT_Street.Text = strStreet;
            addressDlg.TXT_PostalCode.Text = strPostalCode;
            addressDlg.TXT_City.Text = strCity;
            addressDlg.TXT_State.Text = strState;
            addressDlg.TXT_Country.Text = strCountry;
            addressDlg.TXT_ExtentedData.Text = strExtentedData;
            if (addressDlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                strPOBox = addressDlg.TXT_POBox.Text;
                strStreet = addressDlg.TXT_Street.Text;
                strPostalCode = addressDlg.TXT_PostalCode.Text;
                strCity = addressDlg.TXT_City.Text;
                strState = addressDlg.TXT_State.Text;
                strCountry = addressDlg.TXT_Country.Text;
                strExtentedData = addressDlg.TXT_ExtentedData.Text;
            }
        }
        public string strPOBox = "";
        public string strStreet = "";
        public string strPostalCode = "";
        public string strCity = "";
        public string strState  = "";
        public string strCountry  = "";
        public string strExtentedData = "";
    }
}
